<#include "/component/datetime.html" />
<style>
.main_Receipt_table_m table td{
	text-align: left;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
	lun.bindEvent();
});
</script>
<script type="text/javascript" src="${basePath}/js/tds-lunio.js"></script>
<script type="text/javascript">
$(function(){
	lunio.readio();
    $("#imagetab a").click(function(e){
    	e.preventDefault();
    	$(".tab-pane").empty();
    	lunio[$(this).attr("aria-controls")].call();
    	$(this).tab("show");
    });
})

</script>
<form method="post" id="editinfo" action="${basePath}/cluster/lun/save" class="form-horizontal">
	<input type="hidden" name="id" value="${lun.id!}" />
	<div class="ibox">
		<!-- 增加及删除按钮 -->
        <div class="ibox-title fj-angroup2">
            <h5><#if lun.id??>${lun.name}(${lun.poolName})<#else><@spring.message code='button.new'/></#if></h5>
            <#if lun.id??>
            <div class="ibox-tools">
                <!-- <a class="collapse-link" >
                    <i class="fa fa-chevron-up fa-lg"></i>
                </a>
                <a>
                    <i class="fa fa-plus-circle fa-lg"></i>
                </a> -->
                <a id="del">
                    <i class="fa fa-trash fa-lg text-danger"></i>
                </a>
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-list fa-lg text-warning"></i>
                </a>
                <ul class="dropdown-menu dropdown-user" style="border: 1px solid #384c9b;">
                    <li id="forceDel">
                    	<a href="#"><@spring.message code='button.forceDelete'/></a>
                    </li>
                    <#if lun.type == '0'>
                    <li id="qos">
                    	<a href="#"><@spring.message code='lun.qos'/></a>
                    </li>
                    <li id="expand">
                    	<a href="#"><@spring.message code='lun.modifyTotalSize'/></a>
                    </li>
                    <li id="reduce">
                    	<a href="#"><@spring.message code='lun.reduceTotalSize'/></a>
                    </li>
                    <!-- <li id="rollback">
                    	<a href="#"><@spring.message code='lun.rollBack'/></a>
                    </li> -->
                    <#if isChild>
                    <li id="delSnap">
                    	<a href="#"><@spring.message code='lun.deleteSnapshot'/></a>
                    </li>
                    </#if>
                    <#elseif lun.type == '1'>
                    <li id="rollback">
                    	<a href="#"><@spring.message code='lun.rollBack'/></a>
                    </li>
                    <li id="protect">
                    	<a href="#"><@spring.message code='button.protect'/></a>
                    </li>
                    <li id="unprotect">
                    	<a href="#"><@spring.message code='button.removeProtection'/></a>
                    </li>
                    <#else>
                    <li id="flatten">
                    	<a href="#"><@spring.message code='button.fill'/></a>
                    </li>
                    </#if>
					<#if  lun.type != '1'>
					<li id="aclList">
                    	<a href="#"><@spring.message code='lun.mappingHost'/></a>
                    </li>
                    <li id="aclControl">
                    	<a href="#"><@spring.message code='lun.unmappingHost'/></a>
                    </li>
					</#if>
					<#if  lun.type == '0'>
					<li id="migrate">
                    	<a href="#"><@spring.message code='lun.migrate'/></a>
                    </li>
					</#if>
                </ul>
            </div>
            </#if>
        </div>
        <!-- 增加及删除按钮end -->
		<!-- 输入框和展示部分 -->
		<div class="ibox-content fj-blog2">
	        <div class="form-group" id="name"><label class="col-sm-2 control-label"><@spring.message code='pool.name'/>：</label>
	            <div class="col-sm-10">
	            	<#if lun.id??>
						<p class="form-control-static">${lun.name!}</p>
						<input type="hidden" name="name" value="${lun.name!}"/>
					<#else>
						<input type="text" class="form-control" name="name" value="" />
					</#if>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.pool'/>：</label>
	            <div class="col-sm-10">
	            	<#if lun.id??>
						<p class="form-control-static">${lun.poolName!}</p>
						<input type="hidden" name="poolName" value="${lun.poolName!}"/>
					<#else>
						<select  name="poolName" class="form-control m-b">
							<#if poolsList??>
							<#list poolsList as item>
							<option value="${item}" <#if poolName == item>selected="selected"</#if>>${item}</option>
							</#list>
							</#if>
						</select>
					</#if>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
	        <#if lun.id??>
			<input type="hidden" name="parentId" value="${lun.parentId!}" />
			<#else>
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.superSet'/>：</label>
	            <div class="col-sm-10">
	            	<input type="text" id="parent" name="parent" value="${plun.name!}" class="form-control" readonly="readonly" />
					<input type="hidden" name="parentId" value="${plun.id!}"/>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
			</#if>
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.type'/>：</label>
	            <div class="col-sm-10" id="type">
	            	<#if lun.id??>
						<#if lun.type == '0'>
							<p class="form-control-static"><@spring.message code='lunGroup.luns'/></p>
						<#elseif lun.type == '1'>
							<p class="form-control-static"><@spring.message code='lun.snapshot'/></p>
						<#else>
							<p class="form-control-static"><@spring.message code='lun.clone'/></p>
						</#if>
						<input type="hidden" name="type" value="${lun.type!}" />
					<#else>
						<p class="form-control-static"><@spring.message code='lunGroup.luns'/></p>
						<input type="hidden" name="type" value="${plun.type!}" />
					</#if>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
			<#if lun.id??>
				<#if lun.type == '0'>
		        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.size'/>：</label>
		            <div class="col-sm-10" id="size">
		            	<input type="hidden" id="oldSize" value="${lun.size!}" />
						<p class="form-control-static">${lun.fmtSize!}</p>
		            </div>
		        </div>
		        <div class="hr-line-dashed"></div>
				</#if>
			<#else>
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.size'/>(MB)：</label>
	            <div class="col-sm-10" id="size">
	            	<input  type="text" name="size" class="form-control" value=""/>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
			</#if>
			<!-- 	xueqiupeng -->
			<#if lun.type != '1'>
				<#if lun.id??>
					<#if lun.deleted == '0'>
			        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.ifAvailable'/>：</label>
			            <input type="hidden" id="oldSize" value="${lun.size!}" />
			            <div class="col-sm-10">
			            	<p class="form-control-static" id="size"><@spring.message code='lun.available'/></p>
			            </div>
			        </div>
			        <div class="hr-line-dashed"></div>
					<#else>
			        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.ifAvailable'/>：</label>
			            <input type="hidden" id="oldSize" value="${lun.size!}" />
			            <div class="col-sm-10">
			            	<p class="form-control-static" id="size"><@spring.message code='lun.unavailable'/></p>
			            </div>
			        </div>
			        <div class="hr-line-dashed"></div>
					</#if>
				</#if>
			</#if>
			<!-- 	above is writen by xueqiuopeng -->
			<#if lun.id??>
				<#if lun.type != '1'>
		        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.qosType'/>：</label>
		            <div class="col-sm-10" id="qosType">
		            	<#if lun.qosType == '0'>
		            		<p class="form-control-static">IOPS</p>
		            	<#else>
		            		<p class="form-control-static"><@spring.message code='lun.bandwidth'/></p>
		            	</#if>
	    				<input type="hidden" value="${lun.qosType!}" />
		            </div>
		        </div>
		        <div class="hr-line-dashed"></div>
		        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.qosRead'/>：</label>
		            <div class="col-sm-10" id="qosRead">
	            		<p class="form-control-static">${lun.qosRead!}</p>
		            </div>
		        </div>
		        <div class="hr-line-dashed"></div>
		        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.qosWrite'/>：</label>
		            <div class="col-sm-10" id="qosWrite">
	            		<p class="form-control-static">${lun.qosWrite!}</p>
		            </div>
		        </div>
		        <div class="hr-line-dashed"></div>
		        </#if>
				<#if lun.type == '1'>
		        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.ifProtected'/>：</label>
		            <div class="col-sm-10">
		            	<#if lun.isProtected>
		            		<p class="form-control-static"><@spring.message code='common.true'/></p>
		            	<#else>
		            		<p class="form-control-static"><@spring.message code='common.false'/></p>
		            	</#if>
		            </div>
		        </div>
		        <div class="hr-line-dashed"></div>
		        </#if>
		        <#if lun.type != '1'>
			        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.objectSize'/>：</label>
			            <div class="col-sm-10">
			            		<p class="form-control-static">${lun.fmtObjectSize!}</p>
			            </div>
			        </div>
			        <div class="hr-line-dashed"></div>
		        	<div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.used'/>：</label>
			            <div class="col-sm-10">
			            		<p class="form-control-static">${lun.fmtImageCapUsed!}</p>
			            </div>
			        </div>
			        <div class="hr-line-dashed"></div>
			        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.format'/>：</label>
			            <div class="col-sm-10">
			            		<p class="form-control-static">${lun.format!} </p>
			            </div>
			        </div>
			        <div class="hr-line-dashed"></div>
				    <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.mapping'/>：</label>
				          <div class="col-sm-10">
				            	<#if lun.mapping == '1'>
				            		<p class="form-control-static"><@spring.message code='lun.mapped'/></p>
				            	<#else>
				            		<p class="form-control-static"><@spring.message code='lun.unmapped'/></p>
				            	</#if>
				            	<input type="hidden" id="isMapping" value="${lun.mapping!}">
				           </div>
				     </div>
				     <div class="hr-line-dashed"></div>
		        </#if>
		         <#if lun.type == '1'>
		         	<div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.format'/>：</label>
			            <div class="col-sm-10">
			            		<p class="form-control-static">${lun.format!} </p>
			            </div>
			        </div>
			        <div class="hr-line-dashed"></div>
		         </#if>
		        
			<#else>
			<div class="form-group" id="objectSize"><label class="col-sm-2 control-label"><@spring.message code='lun.objectSize'/>(MB)：</label>
	            <div class="col-sm-10">
	            	<select name="objectSize" class="form-control m-b">
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="4" selected>4</option>
						<option value="8">8</option>
					</select>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
	        </#if>
	        <div class="form-group">
		        <div class="col-sm-4 col-sm-offset-2" <#if lun.id??>style="display: none;"</#if> id="buttonDiv">
		            <button class="btn btn-primary" type="button" id="save" style="margin-left: 20px;"><@spring.message code='button.save'/></button>
		            <button class="btn btn-danger" type="button" id="cancel"><@spring.message code='search.clear'/></button>
		        </div>
	    	</div>
	    	<!-- 卷级IO -->
			<#if  lun.type != '1' && lun.id?? >
			<div class="tabs-container" id="imagetab">
			<input type="hidden" id="lunio_poolName" value="${lun.poolName!}"/>
			<input type="hidden" id="lunio_lunName" value="${lun.name!}" />
			<input type="hidden" id="lunio_lunid" value="${lun.id!}" />
		    	<ul class="nav nav-tabs" role="tablist">
					<li role="presentation" class="active"><a href="#readio" role="tab" data-toggle="tab" aria-controls="readio"><@spring.message code='lun.readio'/></a></li>
					<li role="presentation" ><a href="#writeio" role="tab" data-toggle="tab" aria-controls="writeio"><@spring.message code='lun.writeio'/></a></li>
					<li role="presentation" ><a href="#readByte" role="tab" data-toggle="tab" aria-controls="readByte"><@spring.message code='lun.readByte'/></a></li>
					<li role="presentation" ><a href="#writeByte" role="tab" data-toggle="tab" aria-controls="writeByte"><@spring.message code='lun.writeByte'/></a></li>
		        </ul>
		    </div>
			<div class="content">
				<div role="tabpanel" class="tab-pane active" id="readio" ></div>
				<div role="tabpanel" class="tab-pane" id="writeio" ></div>
				<div role="tabpanel" class="tab-pane" id="readByte" ></div>
				<div role="tabpanel" class="tab-pane" id="writeByte" ></div>
			</div>
			</#if>
			<!-- 卷级IO -->
		</div>
		<!-- 输入框及展示部分end -->
	</div>
</form>